package com.mate.constant;

public enum MovieType {
//    0 热映  1 待映  2 经典  3 票房排行 4 点击数排行

    HOT("0","热映"),
    COMING("1","待映"),
    ALREADY("2","经典"),
    RANK("3","票房排行"),
    RANKCLICK("4","点击数排行");

    private String code;
    private String desc;

    MovieType(String code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String codeForDesc(String code){
        for(MovieType movieType : MovieType.values()){
            if(code.equals(movieType.code)){
                return movieType.desc;
            }
        }
        return "";
    }

}
